﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.WindowsAzure.StorageClient;

namespace LCA.Community.DAL.Model
{
    /// <summary>
    /// This class represents a relationship between patients and hospital
    /// 
    /// RowKey = ID of the relationship
    /// PartitionKey = ID of the hospital
    /// </summary>
    public class HospitalPatient : BasicDataModel
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="HospitalPatient"/> class.
        /// </summary>
        public HospitalPatient()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="HospitalPatient"/> class.
        /// </summary>
        /// <param name="patient">The patient.</param>
        /// <param name="hospital">The hospital.</param>
        public HospitalPatient(String patient, String hospital)
        {
            this.RowKey = Guid.NewGuid().ToString();
            this.PartitionKey = hospital;
            this.Patient = patient;
        }

        /// <summary>
        /// Gets or sets the hospital.
        /// </summary>
        /// <value>The hospital.</value>
        public string Hospital
        {
            get
            {
                return PartitionKey;
            }
            set
            {
                PartitionKey = value;
            }
        }
        /// <summary>
        /// Gets or sets the patient's id.
        /// </summary>
        /// <value>The patient's id.</value>
        public String Patient { get; set; }
    }
}
